const Router = require('koa-router');
const { verifyToken } = require('../controller/login.controller');
const {
  getUserList,
  addUser,
  updateUser,
  deleteUser
} = require('../controller/user.controller');

const userRouter = new Router({prefix: '/maintainers/user' });

// 获取用户列表
userRouter.get('/', verifyToken, getUserList);

// 新增用户
userRouter.post('/', addUser);

// 修改用户信息
userRouter.put('/', updateUser);

// 失效用户数据
userRouter.delete('/', deleteUser);

module.exports = userRouter;